Skip to content

VKBRIDGE_SWAPCHAIN_IMAGES: configurable swapchain image count - #83

Open
pgm1207 wants to merge 1 commit into
ASEbrahim:mainfrom
pgm1207:pr/3-swapchain-images
Open

pgm1207 wants to merge 1 commit into
ASEbrahim:mainfrom
pgm1207:pr/3-swapchain-images

Conversation

@pgm1207

@pgm1207 pgm1207 commented Nov 16, 2026

Copy link
Copy Markdown

Problem

The image count is fixed at 3. On the Poco Steam menu, with 3 images and about 24 ms from commit to release, most slow frames waited for a free image.

Change

VKBRIDGE_SWAPCHAIN_IMAGES=1..8, default off (behaviour unchanged), with an info log line of the chosen count.

How tested

Host quick-check 14/14 (RADV). Device runs on both phones (menu; Poco also Megabonk).

Evidence

What is shown (Steam menu, n=1-2, 30 s):

  • Poco, pass-through and early present on: 3 images 102.6 and 102.9 fps (84 % of frames on the 8.3 ms slot); 4 images 116.6, 5 images 117.3, 8 images 118.3 (97-99 %). With 3 images, 452 of 461 slow intervals ended in vkAcquireNextImage with no free image. Most of the gain is there at 4 images; 8 is not better in the menu.
  • CMF Phone 1: 6 images off (3 images) 56.6 vs about 76 fps (n=1).

What is not shown: Megabonk on the Poco, 6 vs 8 images (4 runs, n=1-2 per arm, a different scene each time): 6 images 73.3 fps with 8.9 no-free-image waits/s and 86.3 fps with 0.0/s; 8 images 68.9 fps with 0.0/s and 99.0 fps with 4.5/s. The wait counts do not follow the image count (the same 6-image setting gave 8.9/s and 0.0/s) and fps follows the scene. So there is no evidence that 8 beats 6 in game, and none that it is worse. Some of these runs were USB-powered: no power numbers. On CMF Phone 1 in game (GPU-bound, about 20 fps) the toggles made no measurable difference. Not measured: 4 or 5 images in game, 3 vs 6 in game on the Poco.

Devices: Poco X8 Pro Max (2602BPC18G, Immortalis-G925) and CMF Phone 1 (A015, Mali-G615 MC2, MT6878, 120 Hz). Test app: MaliDeck (a re-signed DroidDeck 0.7.1 test build). Wireless adb. No power numbers are claimed: some runs were USB- or AC-powered.

Steam menu, fps while moving Poco X8 Pro Max CMF Phone 1
stock-like (all new defaults off) 75 (shipped build) 28.7 and 33.2 (2 runs)
all new defaults on 118.5 77.0 and 74.7 (2 runs)

CMF Phone 1, one default turned off at a time (n=1, 30 s each; none off is about 76): ANGLE=vulkan off 37.1, 6 images off 56.6, pass-through off 66.0, early present off 68.6, present reap off 71.2, async create off 74.0.
Poco, cumulative steps: 75 -> 84 (web UI on ANGLE Vulkan) -> 90 (async create) -> 102 (pass-through) -> 118 (early present + 6 images) -> 118.5 (present reap). Frames on the 8.3 ms slot: 71-76 % -> 98.8 %.
Megabonk in game, Poco, 75 s after a 30 s warm-up, p7 vs stock: 83.3 vs 77.9 fps and 110.9 vs 92.3 fps (n=2 per arm, different scenes). A gain of about 5-10 fps is plausible, not proven. CMF Phone 1, Megabonk, p8 defaults vs stock (stock 21.6 and 22.0; p8 20.9, 17.6, and 24.5 with tracing on): no measurable difference, scene noise about 3 fps; the game is GPU-bound there (GPU done 23 ms after commit against a 40 ms present interval), so these toggles are not shown to help a GPU-bound game. No power numbers on CMF Phone 1.

Limitations: attribution rows are single 30 s samples. In-game A/B has scene noise (n=2 per arm). On CMF Phone 1 an "Offline Mode" popup was on screen in all menu runs, so absolute fps may differ from a clean menu. A forced-composite vs pass-through flicker comparison was run only in CMF Phone 1 Megabonk (6 screenshots each, no flicker or tearing seen either way, fps equal within noise); not on the Poco. In the Poco game flicker check, 78 of about 79 composite_why lines were layers=1 / composite=0, one was layers=2, and one frame was black at the Guide-button transition. On CMF Phone 1 the menu was GPU-limited (GPU at max clock 36-97 % of the time) and showed no flicker with pass-through. Quick 30 s menu runs are screening only, not benchmarks. In game the Poco is limited by game CPU and GPU together; the 11 stalls over 50 ms came from game loading/GC, not the bridge.

How to reproduce

Set the toggle named in this text (others at their defaults), open the Steam menu, move the pointer for 30 s, and read frame intervals from the compositor/gamescope frame log (intervals under 100 ms count as in motion). Raw runs and scripts are available on request.

Risks

More images mean more memory and a longer latency queue.

Toggles / defaults

Default off. The DroidDeck session-defaults PR sets 6 when its opt-in is on. I would not go above 6: 8 is accepted (max 8) but not shown to be better, and 4 already gave most of the menu gain. The suggested range is yours to change.

Dropped

Nothing.


[Disclosure: I prepared this change and text with the help of an AI assistant. The measurements come from real device runs; the limits are stated above.]

…off)

On the Wayland path the swapchain has at least 3 images. When the compositor holds all of them (a buffer comes back about
three refreshes after its commit) the game waits for a release before it can draw the next frame, which on a 120 Hz screen
shows as frames missing their slot. VKBRIDGE_SWAPCHAIN_IMAGES=<n> (1-8) raises the minimum to n; unset or 0 keeps the
application's count (at least 3). The chosen count is logged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant